package club.janna.springboot.study.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class JannaAspect {

    @Around("@annotation(club.janna.springboot.study.annotation.JannaAround)")
    public Object round(ProceedingJoinPoint pjp) {
        System.out.println("before");
        Object result = null;
        try {
            result = pjp.proceed();
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
        System.out.println("after");
        return result;
    }

}
